Meteor.methods({
    deleteFile: function(_id) {
        check(_id, String)

        var upload = Uploads.findOne(_id)
        if (upload == null) {
            throw new Meteor.Error(404, 'Upload not found') // maybe some other code
        }

        UploadServer.delete(upload.path)
        Uploads.remove(_id)
    },
})
